package com.niguang.work.api.weChatTemplate.vo;

import lombok.Data;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 整改单抄送模板内容
 */
@Data
public class ZhengGaiCcVo {

    /**
     * 发送信息openId
     */
    private String openId;

    /**
     * 表单ID
     */
    private String contentId;

    /**
     * 标题
     */
    private String title;

    /**
     * 消息类型
     */
    private String infoType;

    /**
     * 项目名称
     */
    private String siteName;

    /**
     * 隐患部位
     */
    private String dangerTitle;

    /**
     * 隐患内容
     */
    private String dangerContext;

    /**
     * 截至时间/整改期限
     */
    private String splitTime;

    /**
     * 隐患级别
     */
    private String dangerLevelText;

    /**
     * 隐患状态
     */
    private String dangerTypeText;

    /**
     * 时间
     */
    private String createTime;

    private String pageType;


    public ZhengGaiCcVo(String openId, Long contentId, String infoType, String siteName, String dangerTitle,
                        String dangerLevelText, String dangerTypeText, String dangerContext, String splitTime) {
        this.title = "隐患提醒(抄送)";
        this.openId = openId;
        this.infoType = infoType;
        this.contentId = String.valueOf(contentId);
        this.dangerContext = dangerContext;
        this.splitTime = splitTime;
        this.siteName = siteName;
        this.dangerTitle = dangerTitle;
        this.dangerLevelText = dangerLevelText;
        this.dangerTypeText = dangerTypeText;
        this.createTime = getDate();
        this.pageType = "1";
    }

    public ZhengGaiCcVo() {
    }

    private String getDate() {
        LocalDateTime ldt = LocalDateTime.now();
        DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss");
        return dtf2.format(ldt);
    }
}
